<template>
    <div class="login">
         <input type="text" v-model="name">
         <input type="text" v-model="pwd">
         <button @click="login">登录</button>
    </div>
</template>
<script>
export default {
    data() {
        return {
            name:'',
            pwd:''
        }
    },
    methods: {
        login(){
            if(this.name!='' && this.pwd !=''){
                localStorage.setItem('token',this.name)
                this.$router.push('/')
            }
        }
    },
}
</script>

